{include file="pub:header"/}
<script type="text/javascript">
$(function(){
	$('.J_tablelist').listTable();
});

function setStatus(id, status) {
	if(!id || id.length == 0)return alert("请选择一条记录");

	$('#myform').attr('action', "{:url('state')}");
	$('#state').val(status);
	ajaxpost('myform');
}
function editInfo(id){
  art.dialog.open('{:url(\'edit\')}?id='+id,{title:'编辑账号信息',id:'cats',width:700,height:450,lock: true,fixed:true,close:function(){location.reload(true);}});
}
function editCash(id){
	art.dialog.open('{:url(\'cashedit\')}?uid='+id,{title:'编辑资金信息',id:'cats',width:700,height:450,lock: true,fixed:true,close:function(){location.reload(true);}});
}
</script>
</head>
<body>


	<div class="subnav">
		<div class="content_menu ib_a blue line_x">
            <a href="javascript:;"><span class="pagetitle">【订单管理】</span></a>
		</div>
	</div>

	<div class="pad_lr_10">

		<form action="{:url('order')}" method="get">

			<table width="100%" cellspacing="0" class="search_form">
			<input type="hidden" name="state" value="{$state}">
				<tbody>
					<tr>
						<td>
							<div class="explain_col">
								订单编号 <input name="sn" type="text" class="input-text" size="20" value="{$sn}">
								商品名称 <input name="keywords" type="text" class="input-text" size="20" value="{$keywords}">
								<select name="time">
									<option value="time"<?php echo 'time'==$time?' selected':'';?>>下单时间</option>
									<option value="time_pay"<?php echo 'time_pay'==$time?' selected':'';?>>支付时间</option>
								</select>
								<input name="starttime" type="text" size="13" id="d4311" onfocus="WdatePicker({maxDate:'#F{ $dp.$D(\'d4312\')}'})" class="input-text Wdate" value="{$starttime}" readonly>
								至
								<input name="endtime" type="text" size="13" id="d4312" onfocus="WdatePicker({minDate:'#F{ $dp.$D(\'d4311\')}'})" class="input-text Wdate" value="{$endtime}" readonly>
								<input type="submit" class="btn" value="搜索" />
							</div>
						</td>
					</tr>
				</tbody>
			</table>

		</form>


      <div class="col_tab" style="margin-top:5px;">
		<ul class="J_tabs tab_grid cu_li">
		   {volist name="reviewary" id="vo"}
		   <li<?php echo $key==$state?' class="current"':'' ?>><a href="{:url('order')}?state={$key}">{$vo}</a></li>
		   {/volist}
		</ul>

		<div class="J_tablelist table_list">

			<table width="100%" cellspacing="0">

				<thead>
					<tr>
						<th align="left">订单编号</th>
						<th align="left">应用名称</th>
						<th align="left">应用类型</th>
						<th align="left">订单金额</th>
						<th align="left">时间</th>
						<th align="left">会员</th>
						<th>是否创建应用</th>
					</tr>
				</thead>

				<form action="" id="myform">
				<input type="hidden" name="state" value="1" id="state">
					<tbody>
						{volist name="list" id="vo"}
						<tr>
							<td>{$vo['order_sn']}</td>
							<td>{$vo['gname']}</td>
							<td>{$vo['attr']}</td>
							<td>￥{$vo['sum']}</td>
							<td align="left">
								支付时间：<?php echo $vo['time_pay']?date('Y-m-d H:i:s',$vo['time_pay']):'<font color=\'red\'>未支付</font>';?><br/>
								下单时间：{$vo['time']|date="Y-m-d H:i:s"}
							</td>
							<td>【{$vo['uid']}】{$urtn[$vo['uid']]}</td>
							<td align="center"><?php echo 1==$vo['state_create']?"<font color='green'>已创建</font>":"<font color='red'>未创建</font>";?></td>
						</tr>
						{/volist}

						{empty name="list"}
						<tr>
							<td colspan="7" align="center">暂无数据 !</td>
						</tr>
						{/empty}
					</tbody>
				</form>

			</table>

		</div>

		</div>


		<div class="btn_wrap_fixed">
			<!--
		    <label class="select_all mr10"><input type="checkbox" name="checkall" class="J_checkall">全选/取消</label>
            <input type="button" value="批量启用" class="btn" onclick="setStatus($.checkBoxValue('id[]'),1)"/>
            <input type="button" value="批量禁用" class="btn" onclick="setStatus($.checkBoxValue('id[]'),2)"/>
            -->
			<div id="pages">{$res|raw}</div>
		</div>

    </div>

{include file="pub:footer" /}
